﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using ComicIsland.Common.Entities.ComicDatabase;
using ComicIsland.Common.Entities.InterfaceJson;

/**
 * 创建时间：2014/12/27 20:12:46
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace ComicIsland.App.Views.ReadComic
{
    public class ImageFrame : INotifyPropertyChanged
    {
        private DbImage _leftFrame;

        private DbImage _midFrame;

        private DbImage _rightFrame;

        public DbImage LeftFrame
        {
            get
            {
                return this._leftFrame;
            }
            set
            {
                if (this._leftFrame != value)
                {
                    this._leftFrame = value;
                    this.OnPropertyChanged("LeftFrame");
                }
            }
        }

        public DbImage MidFrame
        {
            get
            {
                return this._midFrame;
            }
            set
            {
                if (this._midFrame != value)
                {
                    this._midFrame = value;
                    this.OnPropertyChanged("MidFrame");
                }
            }
        }

        public DbImage RightFrame
        {
            get
            {
                return this._rightFrame;
            }
            set
            {
                if (this._rightFrame != value)
                {
                    this._rightFrame = value;
                    this.OnPropertyChanged("RightFrame");
                }
            }
        }

        public ImageFrame()
        {
        }

        public event PropertyChangedEventHandler PropertyChanged;
        //PropertyChangedEventArgs类型，这个类用于传递更改值的属性的名称，实现向客户端已经更改的属性发送更改通知。属性的名称为字符串类型。
        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                //根据PropertyChanged事件的委托类，实现PropertyChanged事件：
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        //protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        //{
        //    PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
        //    if (propertyChangedEventHandler != null)
        //    {
        //        propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName));
        //    }
        //}

        //public event PropertyChangedEventHandler PropertyChanged;
    }
}
